#include "TreadMillConstants.h"

// 初始化静态常量
const std::string TreadMillConstants::APP_INIT = "0A";            // 应用初始化
const std::string TreadMillConstants::APP_SETTING = "0B";         // 应用设置
const std::string TreadMillConstants::APP_RESET = "0C";           // 应用重置
const std::string TreadMillConstants::APP_SET_INCLINE = "0D";     // 设置倾斜度
const std::string TreadMillConstants::APP_CALIBRATE = "1A";       // 校准
const std::string TreadMillConstants::APP_DIAGNOSITICS = "1B";    // 诊断
const std::string TreadMillConstants::APP_WORKOUT_DATA = "A0";    // 锻炼数据
const std::string TreadMillConstants::APP_STATE_CHANGED = "A1";   // 状态改变
const std::string TreadMillConstants::APP_ERROR = "E0";           // 错误
const std::string TreadMillConstants::APP_HEADER = "01";          // 应用头部

const int TreadMillConstants::UCB_STATE_STOPPED = 0;      // 停止
const int TreadMillConstants::UCB_STATE_RUNNING = 1;      // 运行
const int TreadMillConstants::UCB_STATE_READY = 2;        // 准备
const int TreadMillConstants::UCB_STATE_PAUSED = 3;       // 暂停
const int TreadMillConstants::UCB_STATE_ERROR = 4;        // 错误
const int TreadMillConstants::UCB_STATE_STOPPING = 5;     // 停止中

const float TreadMillConstants::SETTING_MPH_0 = 0.5;    // 0 MPH，0.5 mph/sec 加速
const float TreadMillConstants::SETTING_MPH_1 = 0.75;   // 1 MPH，0.75 mph/sec 加速
const float TreadMillConstants::SETTING_KPH_2 = 0.8;    // 2 KPH，0.8 kph/sec 加速
const float TreadMillConstants::SETTING_KPH_3 = 1.2;    // 3 KPH，1.2 kph/sec 加速

const int TreadMillConstants::CALIBRATE_PROGRESS_STARTED = 0;         // 开始
const int TreadMillConstants::CALIBRATE_PROGRESS_INCLINE_UP = 1;      // 倾斜度上升
const int TreadMillConstants::CALIBRATE_PROGRESS_INCLINE_DOWN = 2;    // 倾斜度下降
const int TreadMillConstants::CALIBRATE_PROGRESS_FINISHED = 3;        // 完成
const int TreadMillConstants::CALIBRATE_PROGRESS_ERROR = 4;           // 错误

const int TreadMillConstants::DIAGNOSITICS_OPTION_INCLINE = 5;        // 倾斜度测试
const int TreadMillConstants::DIAGNOSITICS_OPTION_SPEED = 81;         // 速度测试

const int TreadMillConstants::DIAGNOSITICS_PROGRESS_STARTED = 0;      // 诊断进程--开始
const int TreadMillConstants::DIAGNOSITICS_PROGRESS_FINISHED = 3;     // 诊断进程--完成

// 初始化错误代码常量
const int TreadMillConstants::ERROR_SAFETY_KEY = 3;
const int TreadMillConstants::ERROR_NO_SPEED_SENSOR = 81;
const int TreadMillConstants::ERROR_LOW_SPEED = 82;
const int TreadMillConstants::ERROR_INCLINE_NOT_MOVED = 5;
const int TreadMillConstants::ERROR_CALIBRATION_NEEDED = 51;
const int TreadMillConstants::ERROR_MOTOR_RUNAWAY = 4;
const int TreadMillConstants::ERROR_OVER_ACCELERATION = 40;
const int TreadMillConstants::ERROR_OVER_ACCELERATION_START = 41;
const int TreadMillConstants::ERROR_HIGH_SPEED = 83;